package com.kc.business.service.impl;

import com.kc.business.domain.BizBanner;
import com.kc.business.mapper.BizBannerMapper;
import com.kc.business.service.IBizBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * TODO
 *
 * @author zhangshuo
 * @version 1.0
 * @date 2020/9/16
 */
@Service
public class BizBannerServiceImpl implements IBizBannerService {

    @Autowired
    BizBannerMapper bizBannerMapper;

    /**
     * 轮播图列表
     *
     * @param bizBanner
     * @return
     */
    @Override
    public List<BizBanner> getList(BizBanner bizBanner) {
        return bizBannerMapper.select(bizBanner);
    }

    /**
     * 新增轮播图
     *
     * @param bizBanner
     * @return
     */
    @Override
    public int add(BizBanner bizBanner) {
        return bizBannerMapper.insertSelective(bizBanner);
    }

    /**
     * 修改轮播图
     *
     * @param bizBanner
     * @return
     */
    @Override
    public int edit(BizBanner bizBanner) {
        return bizBannerMapper.updateByPrimaryKeySelective(bizBanner);
    }

    /**
     * 删除轮播图
     *
     * @param bannerIds
     * @return
     */
    @Override
    public int delete(String bannerIds) {
        return bizBannerMapper.deleteByIds(bannerIds);
    }
}
